﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace THO7_Team8.Utilities
{
	/// <summary>
	/// Calls the tjerkocr2 for every blob that is provided
	/// </summary>
	public static class OCRWrapper
	{
		/// <summary>
		/// Returns an array of characters (String) containing the letter detected in every blob.
		/// </summary>
		/// <param name="detectedBlobs">The array of detected blobs in Bitmap format</param>
		/// <returns>The characters found in the blob</returns>
		public static String getCharactersFromBlobArray(Bitmap[] detectedBlobs)
		{
			String charactersFound = "";
			tjerkocr2.TestOCRAlgorithm ocr = new tjerkocr2.TestOCRAlgorithm("Tjerk");
			foreach(Bitmap b in detectedBlobs)
			{
				charactersFound += ocr.DoOCRAndGetCandidate(b);
			}
			return charactersFound;
		}
	}
}